import request from '@/utils/request.js'

export default {
  /**
   * 获取审批菜单
   */
  async getApplyMenu(data) {
    return await request({
      url: '/form/Form/menu',
      data: data,
      method: 'POST',
    })
  },
  /**
   * 审批中心数据
   */
  async getApplyOrder(data) {
    return await request({
      url: '/form/Apply/index',
      data: data,
      method: 'POST',
    })
  },
  /**
   * 获取审批单类型
   */
  async getFormTypes(data) {
    return await request({
      url: '/form/Form/formTypes',
      data: data,
      method: 'POST',
    })
  },
  /**
   * 获取审批单详情 表单渲染
   */
  async getApplyDetail(data) {
    return await request({
      url: '/form/Apply/detail',
      data: data,
      method: 'POST',
    })
  },

  /**
   * 获取审批单form process
   */
  async getFormDetail(data) {
    return await request({
      url: '/form/Form/detail',
      data: data,
      method: 'POST',
    })
  },

  // 文件上传
  async fileUpload(data) {
    return await request({
      url: '/form/Form/upload',
      data: data,
      method: 'POST',
    })
  },
  // 提交审批单
  async Applycheck(data) {
    return await request({
      url: '/form/Apply/check',
      data: data,
      method: 'POST',
    })
  },
  // 撤销审批单
  async Applycancel(data) {
    return await request({
      url: '/form/Apply/cancel',
      data: data,
      method: 'POST',
    })
  },
  // 评论
  async Applypublish(data) {
    return await request({
      url: '/form/Apply/publish',
      data: data,
      method: 'POST',
    })
  },

  // 下载
  async ApplydownloadPdf(data) {
    return await request({
      url: '/form/Apply/downloadPdf',
      data: data,
      method: 'POST',
    })
  },

  // 打印
  async ApplygeneratePdf(data) {
    return await request({
      url: '/form/Apply/generatePdf',
      data: data,
      method: 'POST',
    })
  },

  // 撤回
  async ApplycancelComment(data) {
    return await request({
      url: '/form/Apply/cancelComment',
      data: data,
      method: 'POST',
    })
  },

  // 获取审批详细单数据
  async ApplygetApplyDetail(data) {
    return await request({
      url: '/form/Apply/getApplyDetail',
      data: data,
      method: 'POST',
    })
  },

  // 获取草稿箱数据
  async ApplygetDraftLists(data) {
    return await request({
      url: '/form/Apply/getDraftLists',
      data: data,
      method: 'POST',
    })
  },

  // 保存草稿箱数据
  async ApplyaddDraftForm(data) {
    return await request({
      url: '/form/Form/addDraftForm',
      data: data,
      method: 'POST',
    })
  },

  // 删除草稿箱数据
  async ApplydelDraft(data) {
    return await request({
      url: '/form/Apply/delDraft',
      data: data,
      method: 'POST',
    })
  },

  // 获取草稿箱详情
  async ApplygetDraftDetail(data) {
    return await request({
      url: '/form/Apply/getDraftDetail',
      data: data,
      method: 'POST',
    })
  },

  // 分享获取会话数据
  async ApplygetRecentChat(data) {
    return await request({
      url: '/form/DataCenter/getRecentChat',
      data: data,
      method: 'POST',
    })
  },

  // 分享
  async ApplyshareApply(data) {
    return await request({
      url: '/form/DataCenter/shareApply',
      data: data,
      method: 'POST',
    })
  },

  // 催办
  async ApplyUrge(data) {
    return await request({
      url: '/form/Apply/urge',
      data: data,
      method: 'POST',
    })
  },

  // 审批统计
  async ApplyStatistics(data) {
    return await request({
      url: '/form/DataCenter/statistics',
      data: data,
      method: 'POST',
    })
  },
  // 审批统计详情
  async ApplyStatisticsDetail(data) {
    return await request({
      url: '/form/DataCenter/statisticsDetail',
      data: data,
      method: 'POST',
    })
  },


  // 起止码删除接口
  async applyDeletePhoto(data) {
    return await request({
      url: '/form/QrCode/deletePhoto',
      data: data,
      method: 'POST',
    })
  },

  // 获取token
  async applyGenerateToken(data) {
    return await request({
      url: '/form/QrCode/generateToken',
      data: data,
      method: 'POST',
    })
  },

  // 获取token
  async applyGetQrCodeComponents(data) {
    return await request({
      url: '/form/Apply/getQrCodeComponents',
      data: data,
      method: 'POST',
    })
  },
}
